package com.mujin.keji.collectionsystem.module.login.viewmodel;

import android.app.Application;
import android.arch.lifecycle.AndroidViewModel;
import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Transformations;
import android.arch.lifecycle.ViewModelProvider;
import android.support.annotation.NonNull;

/**
 * Created by Administrator on 2018/5/30.
 */

public class MsgAndroidViewModel extends AndroidViewModel {
    private MsgAndroidViewModel(Application application) {
        super(application);
        // 使用 Transformations.switchMap() 方法，表示当 View 改变 mZhihuPageDate 参数的值时，则进行 zhihu 列表数据的请求

    }
    public static class Factory extends ViewModelProvider.NewInstanceFactory {
        @NonNull
        private final Application mApplication;
        public Factory(@NonNull Application application) {
            mApplication = application;
        }
        @Override
        public  AndroidViewModel create(Class modelClass) {
            return new MsgAndroidViewModel(mApplication);
        }
    }
}
